﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;

namespace 群智感知激励系统服务端Core
{
    public class 用户
    {
        Stopwatch stopwatch = new Stopwatch();
        public Socket sock;
        public static List<用户> 用户列表 = new List<用户>();
        public static List<用户> 删除列表 = new List<用户>();
        public int 临时id;
        public 任务 任务;
        Random ran = new Random();
        public 用户(Socket _sock)
        {
            Random ran = new Random();
            临时id = ran.Next(100000000, 999999999);
            sock = _sock;
            stopwatch.Start();
            任务 = new 任务(ran.Next(100, 1000));
        }
        public double 在线时间
        {
            get { return (double)stopwatch.ElapsedMilliseconds/1000; }
        }
        public double 任务完成情况
        {
            get { return 任务.任务完成情况; }
        }
    }
}
